package com.hsz.motion.ui.fragment;

import android.os.Bundle;

import com.hsz.motion.R;
import com.hsz.motion.databinding.FragmentSportrecorddetailsBinding;
import com.hsz.motion.ui.BaseFragment;

import android.os.Bundle;
import android.widget.TextView;
import com.hsz.motion.commmon.bean.PathRecord;
import com.hsz.motion.ui.BaseFragment;
import com.hsz.motion.ui.activity.SportRecordDetailsActivity;

import java.text.DecimalFormat;

/**
 * 运动记录详情-配速
 */
public class SportRecordDetailsSpeedFragment extends BaseFragment {
    private FragmentSportrecorddetailsBinding mBinding;
    private PathRecord pathRecord = null;

    private DecimalFormat decimalFormat = new DecimalFormat("0.00");
    @Override
    public int getLayoutId() {
        return R.layout.fragment_sportrecorddetailsspeed;
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        mBinding= (FragmentSportrecorddetailsBinding) mBaseBinding;
        Bundle bundle = getArguments();
        if (bundle != null) {
            pathRecord = bundle.getParcelable(SportRecordDetailsActivity.SPORT_DATA);
        }

        if (null != pathRecord)
            mBinding.tvDistribution.setText(decimalFormat.format(pathRecord.getDistribution()));
    }


    @Override
    public void initListener() {

    }
}
